package net.knightwatch.kwtools.database; 

import android.database.sqlite.SQLiteDatabase;
import android.util.Log;

public class CustomerTable {
	// Class Information
	private static final String TAG = "CustomerTable";
	// Database Table
	public static final String TABLE_CUSTOMER = "Customers";
	public static final String COLUMN_ID = "_id"; // Customer ID
	public static final String COLUMN_NAME = "name"; // Customer Name
	public static final String COLUMN_CREATE_TIME = "created"; // Date Became Customer
	
	// Database Creation SQL Statement
	private static final String DATABASE_CREATE = "create table " 
			+ TABLE_CUSTOMER
			+ "("
			+ COLUMN_ID + " integer primary key autoincrement, "
			+ COLUMN_NAME + " text not null,"
			+ COLUMN_CREATE_TIME + " datetime" // Unix time
			+ ");";
	public static final String[] ALL_COLUMNS = { COLUMN_ID, COLUMN_NAME};
	
	public static void onCreate(SQLiteDatabase database) {
		Log.i(TAG, "Creating " + TABLE_CUSTOMER + " Table");
		try {
			database.execSQL(DATABASE_CREATE);
		} catch (Exception e){
			Log.v(TAG, e.toString());
		}
	}
	public static void onUpgrade(SQLiteDatabase database, int oldVersion, int newVersion){
		
	}
}
